const express = require('express');
const router = express.Router();
const deployController = require('../controllers/deploy.controller');
const { auth } = require('../middleware/auth.middleware');

// 开始部署
router.post('/:projectId', auth, deployController.startDeploy);

// 获取项目的部署日志
router.get('/:projectId/logs', auth, deployController.getProjectDeployLogs);

// 获取所有部署日志
router.get('/logs', auth, deployController.getAllDeployLogs);

// 回滚到指定版本
router.post('/:projectId/rollback/:deployId', auth, deployController.rollback);

module.exports = router; 